home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #49 (Oct 89) / SC #49.sit / Driver Code / TimeOut.a < prev    next >
Text File  |  1988-01-06  |  2KB  |  73 lines

  1.                 TITLE            'Timeout for serial IO'
  2.                 BLANKS            ON
  3.                 CASE            ON
  4.                 String            Pascal
  5.  
  6.                 PRINT            OFF
  7.                 INCLUDE         'Traps.a'
  8.                 INCLUDE         'ToolEqu.a'
  9.                 INCLUDE         'QuickEqu.a'
  10.                 INCLUDE         'SysEqu.a'
  11.                 INCLUDE         'SysErr.a'
  12.                 INCLUDE         'Quickdraw.inc'
  13.                 INCLUDE         'TimeEqu.a'
  14.                 LOAD            'ProgStrucMacs.d'
  15.                 LOAD            'FlowCtlMacs.d'
  16.                 PRINT            ON
  17.  
  18. ParamBlockSize        equ            108
  19. DCEPtr                equ            csParam+6
  20.                 
  21. DStore                Record        0
  22. WriteUnit            DS.W        1
  23. ReadUnit            DS.W        1
  24. TimeCount            DS.L        1
  25. KillBlock            DS.L        1
  26. KillTask            DS.L        1
  27. IncomingLength        DS.B        1
  28. IncomingString        DS.B        9
  29.                     Align        2
  30. TableOffset            equ            *
  31. TableLen            DS.W        1
  32. Table                DS.W        5
  33.                     ENDR
  34.  
  35. EvRecord            Record        0
  36. myEvent             DS.L        EventRecord     ; Current event info
  37.                     ENDR
  38.                     
  39. Export            Procedure        TimeOutInstall ( KillTask:L , KillPtr:L )
  40.         Begin    Save=A0-A2
  41.         
  42.  
  43.                 Call    _GetNamedResource:L ( #'TMMR':L , #'KillRoutine':A ),A1
  44.                 CMPA            #0,A1
  45.                 If#    NE    Then.S
  46.                     MOVE.L            (A1),A1
  47.                     MOVE.L            KillTask(FP),A0
  48.                     MOVE.L            KillPtr(FP),(A1)
  49.                     LEA                4(A1),A1
  50.                     MOVE.L            A1,tmAddr(A0)
  51.                     _InsTime
  52.                 EndIf#
  53.                 Return
  54.                 
  55.                 ENDP
  56.                 
  57. *  Serial Complete - This routine is the ioCompletion routine for the asynchronously serial
  58. *  IO calls from the pump driver. On completion, the routine posts an app1Evt with the message
  59. *  the parameter block of the completed serial call.
  60.  
  61. Export            Procedure            SerialComplete
  62.         Begin    Save=A5    
  63.  
  64.                 MOVE.L            CurrentA5,A5
  65.                 MOVE.L            A0,D0
  66.                 MOVE.W            #app1Evt,A0
  67.                 _PostEvent
  68.                 
  69.                 Return
  70.                 ENDP                
  71.  
  72.                 END
  73.